#@layout()
#define main()
<h1>图书管理&nbsp;&nbsp;
    #if(session.user.role==0)
    <a href="/book/add">创建图书</a>
    #end
</h1>
#include("_search.html")
<div class="table_box">
    <table class="list">
        <tbody>
        <tr>
            <th width="4%" style="text-align:center;">id</th>
            <th width="15%" style="text-align:center;">图书索书号</th>
            <th width="15%" style="text-align:center;">图书副本编号</th>
            <th width="15%" style="text-align:center;">图书名称</th>
            <th width="15%" style="text-align:center;">图书作者</th>
            <th width="15%" style="text-align:center;">所属书架</th>
            #if(session.user.role==0)
            <th width="15%" style="text-align:center;">操作</th>
            #end
        </tr>

        #for(x : bookPage.getList())
        <tr>
            <td style="text-align:center;">#(x.id)</td>
            <td style="text-align:center;">#(x.bookid)</td>
            <td style="text-align:center;">#(x.bookcopyid)</td>
            <td style="text-align:center;">#(x.bookname)</td>
            <td style="text-align:center;">#(x.bookauthor)</td>
            <td style="text-align:center;">#(x.bookshelfno)</td>
            #if(session.user.role==0)
            <td style="text-align:center;">
                &nbsp;&nbsp;<a href="/book/delete/#(x.id)">删除</a>
                &nbsp;&nbsp;<a href="/book/edit/#(x.id)">修改</a>
            </td>
            #end
        </tr>
        #end
        </tbody>
    </table>
    #@paginate(bookPage.pageNumber, bookPage.totalPage, "/book/")
</div>
#end